<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib prefix="s" uri="http://www.springframework.org/tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>资金流水报表</title>
<jsp:include page="../../head.jsp"/>
<script type="text/javascript" src="<s:url value="/js/ajaxutil.js">"></script>
    </head>
    <script type="text/javascript">
    var formSetting = {
    title: "资金流水报表",
    module: 'query',
    numCount: '2',
    columns: [{
    index: "REGDATE",
    name: "regDate",
    type: "date",
    label: "统计时间起",
    op: "ge"
    }, {
    index: "REGDATE",
    name: "regDate",
    label: "统计时间止",
    type: "date",
    op: "le"
    }],
    buttons: {
    custom: [{
    id: "buildNewReport",
    value: "生成新一期报表",
    click: function () {
    jw.confirm("确定要生成新一期报表？", function () {
    ajaxLoader.ajaxPost("report-buildReport", {}, function (data) {
    try {
    jw.alert(JSON.parse(data.msg).msg);
    } catch (e) {
    }
    setTimeout(function () {
    history.go(0);
    }, 1000);
    });
    });
    }
    }, {
    id: "delLatestReport",
    value: "删除报表统计记录",
    click: function (data) {
    jw.confirm("系统将删除最新一期的报表记录，确定要删除报表统计记录？", function () {
    ajaxLoader.ajaxPost("report-delReport", {}, function (data) {
    try {
    jw.alert(JSON.parse(data.msg).msg);
    } catch (e) {
    }
    setTimeout(function () {
    history.go(0);
    }, 1000);
    });
    });
    }
    }, {
    id: "fundFlowbtn",
    value: "查看资金流水明细",
    click: function () {
    var id = $("#dataGrid").jqGrid(
    "getGridParam", "selrow");
    if (id) {
    var ret = $("#dataGrid").jqGrid(
    'getRowData', id);
    //window.location.href = "flow-main?filters={'groupOp':'AND','rules':[{'field':'regDate','op':'ge','data':'"+ret.preRegDate+"'},{'field':'regDate','op':'le','data':'"+ret.regDate+"'}]}";
    window.location.href = "flow-main";
    } else {
    window.location.href = "flow-main";
    }
    }
    }]
    },
    grid: {
    id: "dataGrid",
    title: "查询结果",
    url: "report-findList",
    colModel: [{
    index: "id",
    name: "id",
    label: "id",
    hidden: true
    }, {
    index: "preRegDate",
    name: "preRegDate",
    formatter: 'date',
    formatoptions: {
    srcformat: 'Y-m-d H:i:s',
    newformat: 'Y-m-d H:i:s'
    },
    label: "上期统计时间"
    }, {
    index: "regDate",
    name: "regDate",
    formatter: 'date',
    formatoptions: {
    srcformat: 'Y-m-d H:i:s',
    newformat: 'Y-m-d H:i:s'
    },
    label: "本期统计时间"
    }, {
    index: "preBalance",
    name: "preBalance",
    label: "上期统计结余（元）"
    }, {
    index: "income",
    name: "income",
    label: "本期预付金额(元)"
    }, {
    index: "cost",
    name: "cost",
    label: "本期支出总额(元)"
    }, {
    index: "balance",
    name: "balance",
    label: "本期统计结余(元)"
    }],
    sortname: "regDate",
    sortorder: "desc",
    jsonReader: {
    root: "datas"
    },
    loadComplete: function (data) {
    }
    }
    };
    $(document).ready(function () {
    $("#dataTable").mrdForm(formSetting);
    });
    </script>
    <body>
    <div id="dataTable"></div>
    </body>
    </html>
